package com.grsu.phonestation.dao.impl;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.grsu.phonestation.dao.TypePaymentDAO;
import com.grsu.phonestation.dao.impl.base.AbstractHibernateDAO;
import com.grsu.phonestation.domain.TypePayment;

@Repository
public class TypePaymentDAOImpl extends AbstractHibernateDAO<TypePayment, Integer>
implements TypePaymentDAO{

	@Override
	public TypePayment findById(Integer typePaymentId) {
		Criteria criteria = getSession().createCriteria(
				TypePayment.class, "typePayment").add(
				Restrictions.eq("id", typePaymentId));
		return (TypePayment)criteria.uniqueResult();
	}
}
